package per.turtle.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.OrderBy;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import per.turtle.common.core.annotation.validate.MaxSizeWithCharset;
import per.turtle.common.core.web.entity.BaseEntity;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author turtle
 */
@Schema(name = "SysPost", description = "岗位")
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sys_post")
public class SysPost extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @Schema(description = "岗位序号")
    @TableId(type = IdType.ASSIGN_UUID)
    private String postId;

    @Schema(description = "岗位编码")
    @NotBlank(message = "岗位编码不能为空")
    @MaxSizeWithCharset(max = 31, message = "岗位编码超出限定长度！")
    private String postCode;

    @Schema(description = "岗位名称")
    @NotBlank(message = "岗位名称不能为空")
    @MaxSizeWithCharset(max = 63, message = "岗位名称超出限定长度！")
    private String postName;

    @Schema(description = "显示顺序")
    @Max(value = 9999, message = "显示顺序取值范围在4位数以内")
    @Min(value = 1, message = "显示顺序取值需大于0")
    @NotNull(message = "显示顺序不能为空")
    @OrderBy(asc = true)
    private Integer orderNum;

    @Schema(description = "是否停用（1：是；0：否）")
    private Boolean isDisabled;

}
